import { createStore } from 'vuex'
import createPersistedState from 'vuex-persistedstate'

import user from './modules/user.js'
import cart from './modules/cart.js'
import category from './modules/category.js'

export default createStore({
  modules: {
    user,
    cart,
    category
  },
  plugins:[
    createPersistedState({
      // 本地存储名字
      key: 'eribbit-client-pc-01-store',
      // 指定需要存储的模块
      paths:['user','cart']
    })
  ]
})
